<!-- SEARCH CONSUMER REVIEWS -->

<?php
$car_make = $this->pickup_model->get_car_makes();
$cur_url =  base_url().$this->uri->uri_string; 
//print $cur_url;
?>



<div class="box_2 border" >
    <div class="title bold reg"> Consumer Car Reviews </div>

    <div class="small_text_box works-list"> 
        <div>Read thousands of reviews on new cars.</div>
        <form id="sbar_review" method="post" action="<?= base_url(); ?>review/search/">
            <?php if ($this->session->flashdata('error')){ ?>
                <div class="error"><?=$this->session->flashdata('error');?></div>'
            <?php }?>
            
            <div class="rowElem">
                <div class="fleft">
                    <label><strong>Make:</strong></label>
                    <input name="redirect" type="hidden" value="<?=$cur_url;?>" />
                    <select name="car_make" onChange="get_ReviewCarModel(this.value,'<?= base_url(); ?>','review_car_modeldiv');">
                        <option value="0" selected>Select Make</option>
                        <?php foreach ($car_make as $car_make): ?> 
                            <option value="<?= $car_make->id; ?>"><?= $car_make->make; ?></option>
                        <?php endforeach; ?>
                    </select>
                </div>
            </div>
            <div class="rowElem">
                <div class="fleft">
                    <label><strong>Model:</strong></label>
                    <div id="review_car_modeldiv">
                        <select name="car_model" onChange="get_ReviewCarVersion(this.value,'<?= base_url(); ?>');">>
                            <option value="" selected="selected">Model</option>
                            <option value="" disabled="disabled">----------------</option>
                        </select>  
                    </div>
                </div>
            </div>

            <div class="rowElem">
                <div class="fleft">
                    <label><strong>Version:</strong></label>
                    <div id="review_ver_div">
                        <select name="car_version" >
                            <option value="" selected>Any Make</option>
                        </select>
                    </div>
                </div>
            </div>

            <div class="clear"></div>
            <div>
                <a onClick="document.getElementById('sbar_review').submit()" class="inline-block button_search color_1 bold"><span class="inline-block">View Reviews</span> </a>
                <span class="inline-block" style="margin-left: 20px">
                    <a href="<?= base_url(); ?>review/"> <strong> Write Review </strong> </a> 
                </span>
            </div>
        </form>
    </div>
</div>
